package com.zq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.zq.entity.User;
import com.zq.entity.User2;
import com.zq.service.UserService;

@Controller
public class UserController {
	@Autowired
	private UserService service;
	@RequestMapping("list.do")
	public String getList(Model model,User2 user,@RequestParam(defaultValue="1") Integer pageNum){
		System.out.println(user);
		PageInfo<User> info=service.getList(user,pageNum);
		model.addAttribute("info", info);
		model.addAttribute("user", user);
		return "list";
	}

}
